package Others.DesignPattern.FactoryPattern.Original.Object1;

public class LeiFengSimpleFactory {

    public static LeiFeng createLeiFeng(String type) {
        if (type.equals("大学生")) {
            System.out.println("创建大学生对象");
            return new Undergraduate();
        } else if (type.equals("志愿者")) {
            System.out.println("创建志愿者对象");
            return new Volunteer();
        } else {
            System.out.println("type类型错误，创建对象失败！");
            return null;
        }
    }

}
